﻿
declare module SP {
    export module JsGrid {

        export class ColumnInfo {

            public bOpenMenuOnContentClick: boolean;

            public columnKey: string;
            public fieldKeys: string[];

            public fnShouldLinkSingleValue: (record, fieldKey, singleDataValue, singleLocalizedValue) => boolean;
            public fnSingleValueClicked: (record, fieldKey, singleDataValue, singleLocalizedValue) => void;
            public fnGetEditControlName: (record, fieldKey) => string;

            public imgRawSrc: string;
            public imgSrc: string;

            public isAutoFilterable: boolean;
            public isHidable: boolean;
            public isResizable: boolean;
            public isSortable: boolean;
            public isVisible: boolean;

            public name: boolean;
            public width: number;
        }

        export class EmptyValue {
        }

        export class Utility {
            public static IsChar(value: any): boolean;
        }

        export enum EditActorReadType {
            Both = 1,
            LocalizedOnly = 2,
            DataOnly = 3
        }

        export enum EditActorWriteType {
            Both = 1,
            LocalizedOnly = 2,
            DataOnly = 3,
            Either= 4
        }

        export module PropertyType {
            export class Utils {
                public static RegisterEditControl(id: string, registrationCallback: (gridContext: any, control: any) => JsGrid.EditControl);
            }
        }

        export class EditControl {

            public SupportedWriteMode: SP.JsGrid.EditActorWriteType;
            public SupportedReadMode: SP.JsGrid.EditActorReadType;

            public BindToCell(cellContext: any);
            public OnCellMove();

            public Focus(eventInfo: any);

            public OnBeginEdit(eventInfo: any);
            public OnEndEdit(eventInfo: any);

            public Unbind();
            public Dispose();

        }
    }
}